package cn.strongme.security.api;

import cn.strongme.security.common.util.R;
import cn.strongme.security.service.UserService;
import cn.strongme.security.util.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 * email: <a href="strongwalter2014@gmail.com">阿水</a>
 *
 * @author 阿水
 * @date 2018/7/28 23:39.
 */

@RestController
public class HomeController {

    @Autowired
    private UserService userService;

    @GetMapping("my")
    public R info() {
        return R.okData(userService.loadUserByUsername(UserUtils.getUsername()));
    }

}
